package com.itheima.object;

public class Student {
    private String name;
    private int age;

    public void setName(String n ){
        name = n;
    }
    public String getName(){
        return name;
    }
    public void setAge(int a ){
        if(a>=0&&a<=120){
            age = a;
        }else{
            System.out.println("您的年龄不合理");
        }

    }
    public  int getAge(){
        return age;
    }

    public  void show() {
        System.out.println(getName()+"..."+getAge());
    }
}
